package slash.world;

import java.util.ArrayList;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import slash.entities.AbstractEntity;
import slash.entities.LivingEntity;

/**
 * A "template" layer of a map that
 * contains, renders, and updates a group
 * of entities on the map
 * @author Julien Gilbert
 *
 */
public abstract class MapLayer {
	
	private Boolean enabled;
	
	public MapLayer(){
		enabled = true;
	}
	
	/**
	 * Returns if the map layer is enabled
	 * to render and update
	 */
	public boolean isEnabled(){
		return enabled;
	}
	
	/**
	 * Abstract method that returns an array list
	 * of the layer's objects as abstract "map" entities
	 */
	public abstract ArrayList<AbstractEntity> getObjects();
	
	/**
	 * Sets whether the map layer
	 * enabled or not
	 */
	public void setEnabled(Boolean flag){
		enabled = flag;
	}
	
	/**
	 * Renders all objects in layer
	 * Par: graphics
	 */
	public abstract void render(Graphics g);
	
	
	/**
	 * Updates all objects in layer
	 * Par: time since last update
	 */
	public abstract void update(GameContainer container, int time);

}
